package com.lagou.curator;

import org.I0Itec.zkclient.ZkClient;

/**
 * NoteCurator
 *
 * @author achilles
 */
public class NoteCurator {

    private ZkClient zkClient;

    public NoteCurator() {
        zkClient = new ZkClient("101.37.159.186:2181");
    }

    /**
     * 创建节点
     */
    public void createNote( String content) {
        // 创建节点
        String path = "/lg-curator/server";
        String s = null;
        try {
            s = zkClient.createEphemeralSequential(path, content);
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("节点递归创建成功，该节点路径" + s);
    }
}
